home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / qix.c < prev    next >
C/C++ Source or Header  |  2000-05-04  |  44KB  |  1,111 lines

  1. /***************************************************************************
  2.  
  3. Qix/ZooKeeper/Space Dungeon
  4. ------------- ------ ---
  5.  
  6. driver by John Butler, Ed Mueller, Aaron Giles
  7.  
  8.  
  9. Qix uses two 6809 CPUs:  one for data and sound and the other for video.
  10. Communication between the two CPUs is done using a 4K RAM space at $8000
  11. (for ZooKeeper the data cpu maps it at $0000 and the video cpu at $8000)
  12. which both CPUs have direct access.  FIRQs (fast interrupts) are generated
  13. by each CPU to interrupt the other at specific times.
  14.  
  15. A third CPU, a 6802, is used for sample playback.  It drives an 8-bit
  16. DAC and according to the schematics a TMS5220 speech chip, which is never
  17. accessed.  ROM u27 is the only code needed.  A sound command from the
  18. data CPU causes an IRQ to fire on the 6802 and the sound playback is
  19. started.
  20.  
  21. The coin door switches and player controls are connected to the CPUs by
  22. Mototola 6821 PIAs.  These devices are memory mapped as shown below.
  23.  
  24. The screen is 256x256 with eight bit pixels (64K).  The screen is divided
  25. into two halves each half mapped by the video CPU at $0000-$7FFF.  The
  26. high order bit of the address latch at $9402 specifies which half of the
  27. screen is being accessed.
  28.  
  29. Timing is critical in the hardware.  The data CPU must have an interrupt
  30. signal generated externally at the right frequency to make the game play
  31. correctly.
  32.  
  33. The address latch works as follows.  When the video CPU accesses $9400,
  34. the screen address is computed by using the values at $9402 (high byte)
  35. and $9403 (low byte) to get a value between $0000-$FFFF.  The value at
  36. that location is either returned or written.
  37.  
  38. The scan line at $9800 on the video CPU records where the scan line is
  39. on the display (0-255).  Several places in the ROM code wait until the
  40. scan line reaches zero before continuing.
  41.  
  42. QIX CPU #1 (Data/Sound):
  43.     $8000 - $83FF:  Dual port RAM accessible by both processors
  44.     $8400 - $87FF:  Local Memory
  45.     $8800        :  ACIA base address
  46.     $8C00        :  Video FIRQ activation
  47.     $8C01        :  Data FIRQ deactivation
  48.     $9000        :  Sound PIA
  49.     $9400        :  [76543210] Game PIA 1 (Port A)
  50.                      o         Fast draw
  51.                       o        1P button
  52.                        o       2P button
  53.                         o      Slow draw
  54.                          o     Joystick Left
  55.                           o    Joystick Down
  56.                            o   Joystick Right
  57.                             o  Joystick Up
  58.     $9402        :  [76543210] Game PIA 1 (Port B)
  59.                      o         Tilt
  60.                       o        Coin sw      Unknown
  61.                        o       Right coin
  62.                         o      Left coin
  63.                          o     Slew down
  64.                           o    Slew up
  65.                            o   Sub. test
  66.                             o  Adv. test
  67.     $9900        :  Game PIA 2
  68.     $9C00        :  Game PIA 3
  69.  
  70. ZOOKEEPER CPU #1 (Data/Sound):
  71.     $0000 - $03FF:  Dual Port RAM accessible by both processors
  72.     $0400 - $07FF:  Local Memory
  73.     $0800        :  ACIA base address
  74.     $0C00        :  Video FIRQ activation
  75.     $0C01        :  Data FIRQ deactivation
  76.     $1000        :  Sound PIA
  77.     $1400        :  [76543210] Game PIA 1 (Port A)
  78.                      o         Fast draw
  79.                       o        1P button
  80.                        o       2P button
  81.                         o      Slow draw
  82.                          o     Joystick Left
  83.                           o    Joystick Down
  84.                            o   Joystick Right
  85.                             o  Joystick Up
  86.     $1402        :  [76543210] Game PIA 1 (Port B)
  87.                      o         Tilt
  88.                       o        Coin sw      Unknown
  89.                        o       Right coin
  90.                         o      Left coin
  91.                          o     Slew down
  92.                           o    Slew up
  93.                            o   Sub. test
  94.                             o  Adv. test
  95.     $1900        :  Game PIA 2
  96.     $1C00        :  Game PIA 3
  97.  
  98. CPU #2 (Video):
  99.     $0000 - $7FFF:  Video/Screen RAM
  100.     $8000 - $83FF:  Dual port RAM accessible by both processors
  101.     $8400 - $87FF:  CMOS backup and local memory
  102.     $8800        :  LED output and color RAM page select
  103.     $8801         :  EPROM page select (ZooKeeper only)
  104.     $8C00        :  Data FIRQ activation
  105.     $8C01        :  Video FIRQ deactivation
  106.     $9000        :  Color RAM
  107.     $9400        :  Address latch screen location
  108.     $9402        :  Address latch Hi-byte
  109.     $9403        :  Address latch Lo-byte
  110.     $9800        :  Scan line location
  111.     $9C00        :  CRT controller base address
  112.  
  113. QIX NONVOLATILE CMOS MEMORY MAP (CPU #2 -- Video) $8400-$87ff
  114.     $86A9 - $86AA:    When CMOS is valid, these bytes are $55AA
  115.     $86AC - $86C3:    AUDIT TOTALS -- 4 4-bit BCD digits per setting
  116.                     (All totals default to: 0000)
  117.                     $86AC: TOTAL PAID CREDITS
  118.                     $86AE: LEFT COINS
  119.                     $86B0: CENTER COINS
  120.                     $86B2: RIGHT COINS
  121.                     $86B4: PAID CREDITS
  122.                     $86B6: AWARDED CREDITS
  123.                     $86B8: % FREE PLAYS
  124.                     $86BA: MINUTES PLAYED
  125.                     $86BC: MINUTES AWARDED
  126.                     $86BE: % FREE TIME
  127.                     $86C0: AVG. GAME [SEC]
  128.                     $86C2: HIGH SCORES
  129.     $86C4 - $86FF:    High scores -- 10 scores/names, consecutive in memory
  130.                     Six 4-bit BCD digits followed by 3 ascii bytes
  131.                     (Default: 030000 QIX)
  132.     $8700         :    LANGUAGE SELECT (Default: $32)
  133.                     ENGLISH = $32  FRANCAIS = $33  ESPANOL = $34  DEUTSCH = $35
  134.     $87D9 - $87DF:    COIN SLOT PROGRAMMING -- 2 4-bit BCD digits per setting
  135.                     $87D9: STANDARD COINAGE SETTING  (Default: 01)
  136.                     $87DA: COIN MULTIPLIERS LEFT (Default: 01)
  137.                     $87DB: COIN MULTIPLIERS CENTER (Default: 04)
  138.                     $87DC: COIN MULTIPLIERS RIGHT (Default: 01)
  139.                     $87DD: COIN UNITS FOR CREDIT (Default: 01)
  140.                     $87DE: COIN UNITS FOR BONUS (Default: 00)
  141.                     $87DF: MINIMUM COINS (Default: 00)
  142.     $87E0 - $87EA:    LOCATION PROGRAMMING -- 2 4-bit BCD digits per setting
  143.                     $87E0: BACKUP HSTD [0000] (Default: 03)
  144.                     $87E1: MAXIMUM CREDITS (Default: 10)
  145.                     $87E2: NUMBER OF TURNS (Default: 03)
  146.                     $87E3: THRESHOLD (Default: 75)
  147.                     $87E4: TIME LINE (Default: 37)
  148.                     $87E5: DIFFICULTY 1 (Default: 01)
  149.                     $87E6: DIFFICULTY 2 (Default: 01)
  150.                     $87E7: DIFFICULTY 3 (Default: 01)
  151.                     $87E8: DIFFICULTY 4 (Default: 01)
  152.                     $87E9: ATTRACT SOUND (Default: 01)
  153.                     $87EA: TABLE MODE (Default: 00)
  154.  
  155. COIN PROCESSOR
  156.  
  157. $0000 (PORTA)  : Bi directional communication to the data CPU
  158. $0001 (PORTB)  :  [76543210] Game PIA 1 (Port B)
  159.                    o         SPARE          output
  160.                     o        Coin lockout   output
  161.                      o       Coin lockout   output
  162.                       o      Tilt           input
  163.                        o     Slew down      input
  164.                         o    Slew up        input
  165.                          o   Sub. test      input
  166.                           o  Adv. test      input
  167.  
  168. $0002 (PORTC)  :  [76543210] Game PIA 1 (Port B)
  169.                        o     From DATA cpu      input
  170.                         o    Aux coin switch    input
  171.                          o   Right coin switch  input
  172.                           o  Left coin switch   input
  173.  
  174. INT input   : From data cpu
  175. Timer input : From data cpu
  176.  
  177. ***************************************************************************/
  178.  
  179. #include "driver.h"
  180. #include "vidhrdw/generic.h"
  181. #include "machine/6821pia.h"
  182.  
  183.  
  184. READ_HANDLER( sdungeon_68705_portA_r );
  185. READ_HANDLER( sdungeon_68705_portB_r );
  186. READ_HANDLER( sdungeon_68705_portC_r );
  187. WRITE_HANDLER( sdungeon_68705_portA_w );
  188. WRITE_HANDLER( sdungeon_68705_portB_w );
  189. WRITE_HANDLER( sdungeon_68705_portC_w );
  190. WRITE_HANDLER( sdungeon_68705_ddrA_w );
  191. WRITE_HANDLER( sdungeon_68705_ddrB_w );
  192. WRITE_HANDLER( sdungeon_68705_ddrC_w );
  193. WRITE_HANDLER( sdungeon_pia_0_w );
  194.  
  195. extern unsigned char *qix_sharedram;
  196. READ_HANDLER( qix_scanline_r );
  197. WRITE_HANDLER( qix_data_firq_w );
  198. WRITE_HANDLER( qix_video_firq_w );
  199.  
  200.  
  201. extern unsigned char *qix_palettebank;
  202. extern unsigned char *qix_videoaddress;
  203.  
  204. READ_HANDLER( qix_videoram_r );
  205. WRITE_HANDLER( qix_videoram_w );
  206. READ_HANDLER( qix_addresslatch_r );
  207. WRITE_HANDLER( qix_addresslatch_w );
  208. WRITE_HANDLER( qix_paletteram_w );
  209. WRITE_HANDLER( qix_palettebank_w );
  210.  
  211. READ_HANDLER( qix_sharedram_r );
  212. WRITE_HANDLER( qix_sharedram_w );
  213. int qix_interrupt_video(void);
  214. void qix_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  215. int qix_vh_start(void);
  216. void qix_vh_stop(void);
  217. void qix_init_machine(void);
  218. void withmcu_init_machine(void);
  219.  
  220. READ_HANDLER( qix_data_io_r );
  221. READ_HANDLER( qix_sound_io_r );
  222. WRITE_HANDLER( qix_data_io_w );
  223. WRITE_HANDLER( qix_sound_io_w );
  224.  
  225. WRITE_HANDLER( zoo_bankswitch_w );
  226. extern void zoo_init_machine(void);
  227.  
  228.  
  229.  
  230. static unsigned char *nvram;
  231. static size_t nvram_size;
  232.  
  233. static void nvram_handler(void *file,int read_or_write)
  234. {
  235.     if (read_or_write)
  236.         osd_fwrite(file,nvram,nvram_size);
  237.     else
  238.     {
  239.         if (file)
  240.             osd_fread(file,nvram,nvram_size);
  241.         else
  242.             memset(nvram,0,nvram_size);
  243.     }
  244. }
  245.  
  246.  
  247.  
  248. static struct MemoryReadAddress readmem[] =
  249. {
  250.     { 0x8000, 0x83ff, qix_sharedram_r },
  251.     { 0x8400, 0x87ff, MRA_RAM },
  252.     { 0x8800, 0x8800, MRA_RAM },   /* ACIA */
  253.     { 0x9000, 0x9003, pia_3_r },
  254.     { 0x9400, 0x9403, pia_0_r },
  255.     { 0x9900, 0x9903, pia_1_r },
  256.     { 0x9c00, 0x9FFF, pia_2_r },
  257.     { 0xa000, 0xffff, MRA_ROM },
  258.     { -1 } /* end of table */
  259. };
  260.  
  261. static struct MemoryReadAddress zoo_readmem[] =
  262. {
  263.     { 0x0000, 0x03ff, qix_sharedram_r },
  264.     { 0x0400, 0x07ff, MRA_RAM },
  265.     { 0x1000, 0x1003, pia_3_r },    /* Sound PIA */
  266.     { 0x1400, 0x1403, pia_0_r },    /* Game PIA 1 - Player inputs, coin door switches */
  267.     { 0x1900, 0x1903, pia_1_r },    /* Game PIA 2 */
  268.     { 0x1c00, 0x1fff, pia_2_r },    /* Game PIA 3 - Player 2 */
  269.     { 0x8000, 0xffff, MRA_ROM },
  270.     { -1 } /* end of table */
  271. };
  272.  
  273. static struct MemoryReadAddress readmem_video[] =
  274. {
  275.     { 0x0000, 0x7fff, qix_videoram_r },
  276.     { 0x8000, 0x83ff, qix_sharedram_r },
  277.     { 0x8400, 0x87ff, MRA_RAM },
  278.     { 0x9400, 0x9400, qix_addresslatch_r },
  279.     { 0x9800, 0x9800, qix_scanline_r },
  280.     { 0xa000, 0xffff, MRA_ROM },
  281.     { -1 } /* end of table */
  282. };
  283.  
  284. static struct MemoryReadAddress zoo_readmem_video[] =
  285. {
  286.     { 0x0000, 0x7fff, qix_videoram_r },
  287.     { 0x8000, 0x83ff, qix_sharedram_r },
  288.     { 0x8400, 0x87ff, MRA_RAM },
  289.     { 0x9400, 0x9400, qix_addresslatch_r },
  290.     { 0x9800, 0x9800, qix_scanline_r },
  291.     { 0xa000, 0xbfff, MRA_BANK1 },
  292.     { 0xc000, 0xffff, MRA_ROM },
  293.     { -1 } /* end of table */
  294. };
  295.  
  296. static struct MemoryReadAddress readmem_sound[] =
  297. {
  298.     { 0x0000, 0x007f, MRA_RAM },
  299.     { 0x2000, 0x2003, pia_5_r },
  300.     { 0x4000, 0x4003, pia_4_r },
  301.     { 0xf000, 0xffff, MRA_ROM },
  302.     { -1 } /* end of table */
  303. };
  304.  
  305. static struct MemoryReadAddress zoo_readmem_sound[] =
  306. {
  307.     { 0x0000, 0x007f, MRA_RAM },
  308.     { 0x2000, 0x2003, pia_5_r },
  309.     { 0x4000, 0x4003, pia_4_r },
  310.     { 0xd000, 0xffff, MRA_ROM },
  311.     { -1 } /* end of table */
  312. };
  313.  
  314.  
  315. static struct MemoryWriteAddress writemem[] =
  316. {
  317.     { 0x8000, 0x83ff, qix_sharedram_w, &qix_sharedram },
  318.     { 0x8400, 0x87ff, MWA_RAM },
  319.     { 0x8c00, 0x8c00, qix_video_firq_w },
  320.     { 0x9000, 0x9003, pia_3_w },
  321.     { 0x9400, 0x9403, sdungeon_pia_0_w },
  322.     { 0x9900, 0x9903, pia_1_w },
  323.     { 0x9c00, 0x9fff, pia_2_w },
  324.     { 0xa000, 0xffff, MWA_ROM },
  325.     { -1 } /* end of table */
  326. };
  327.  
  328. static struct MemoryWriteAddress zoo_writemem[] =
  329. {
  330.     { 0x0000, 0x03ff, qix_sharedram_w, &qix_sharedram },
  331.     { 0x0400, 0x07ff, MWA_RAM },
  332.     { 0x0c00, 0x0c00, qix_video_firq_w },
  333.     { 0x0c01, 0x0c01, MWA_NOP },    /* interrupt acknowledge */
  334.     { 0x1000, 0x1003, pia_3_w },    /* Sound PIA */
  335.     { 0x1400, 0x1403, sdungeon_pia_0_w },    /* Game PIA 1 */
  336.     { 0x1900, 0x1903, pia_1_w },    /* Game PIA 2 */
  337.     { 0x1c00, 0x1fff, pia_2_w },    /* Game PIA 3 */
  338.     { 0x8000, 0xffff, MWA_ROM },
  339.     { -1 } /* end of table */
  340. };
  341.  
  342. static struct MemoryWriteAddress writemem_video[] =
  343. {
  344.     { 0x0000, 0x7fff, qix_videoram_w },
  345.     { 0x8000, 0x83ff, qix_sharedram_w },
  346.     { 0x8400, 0x87ff, MWA_RAM, &nvram, &nvram_size },
  347.     { 0x8800, 0x8800, qix_palettebank_w, &qix_palettebank },
  348.     { 0x8c00, 0x8c00, qix_data_firq_w },
  349.     { 0x9000, 0x93ff, qix_paletteram_w, &paletteram },
  350.     { 0x9400, 0x9400, qix_addresslatch_w },
  351.     { 0x9402, 0x9403, MWA_RAM, &qix_videoaddress },
  352.     { 0x9c00, 0x9FFF, MWA_RAM }, /* Video controller */
  353.     { 0xa000, 0xffff, MWA_ROM },
  354.     { -1 } /* end of table */
  355. };
  356.  
  357. static struct MemoryWriteAddress zoo_writemem_video[] =
  358. {
  359.     { 0x0000, 0x7fff, qix_videoram_w },
  360.     { 0x8000, 0x83ff, qix_sharedram_w },
  361.     { 0x8400, 0x87ff, MWA_RAM, &nvram, &nvram_size },    /////protected when coin door is closed
  362.     { 0x8800, 0x8800, qix_palettebank_w, &qix_palettebank },    /* LEDs are upper 6 bits */
  363.     { 0x8801, 0x8801, zoo_bankswitch_w },
  364.     { 0x8c00, 0x8c00, qix_data_firq_w },
  365.     { 0x8c01, 0x8c01, MWA_NOP },    /* interrupt acknowledge */
  366.     { 0x9000, 0x93ff, qix_paletteram_w, &paletteram },
  367.     { 0x9400, 0x9400, qix_addresslatch_w },
  368.     { 0x9402, 0x9403, MWA_RAM, &qix_videoaddress },
  369.     { 0xa000, 0xffff, MWA_ROM },
  370.     { -1 } /* end of table */
  371. };
  372.  
  373. static struct MemoryWriteAddress writemem_sound[] =
  374. {
  375.     { 0x0000, 0x007f, MWA_RAM },
  376.     { 0x2000, 0x2003, pia_5_w },
  377.     { 0x4000, 0x4003, pia_4_w },
  378.     { 0xf000, 0xffff, MWA_ROM },
  379.     { -1 } /* end of table */
  380. };
  381.  
  382. static struct MemoryWriteAddress zoo_writemem_sound[] =
  383. {
  384.     { 0x0000, 0x007f, MWA_RAM },
  385.     { 0x2000, 0x2003, pia_5_w },
  386.     { 0x4000, 0x4003, pia_4_w },
  387.     { 0xd000, 0xffff, MWA_ROM },
  388.     { -1 } /* end of table */
  389. };
  390.  
  391. static struct MemoryReadAddress mcu_readmem[] =
  392. {
  393.     { 0x0000, 0x0000, sdungeon_68705_portA_r },
  394.     { 0x0001, 0x0001, sdungeon_68705_portB_r },
  395.     { 0x0002, 0x0002, sdungeon_68705_portC_r },
  396.     { 0x0010, 0x007f, MRA_RAM },
  397.     { 0x0080, 0x07ff, MRA_ROM },
  398.     { -1 }  /* end of table */
  399. };
  400.  
  401. static struct MemoryWriteAddress mcu_writemem[] =
  402. {
  403.     { 0x0000, 0x0000, sdungeon_68705_portA_w },
  404.     { 0x0001, 0x0001, sdungeon_68705_portB_w },
  405.     { 0x0002, 0x0002, sdungeon_68705_portC_w },
  406.     { 0x0004, 0x0004, sdungeon_68705_ddrA_w },
  407.     { 0x0005, 0x0005, sdungeon_68705_ddrB_w },
  408.     { 0x0006, 0x0006, sdungeon_68705_ddrC_w },
  409.     { 0x0010, 0x007f, MWA_RAM },
  410.     { 0x0080, 0x07ff, MWA_ROM },
  411.     { -1 }  /* end of table */
  412. };
  413.  
  414.  
  415.  
  416. #define COIN_PORT \
  417.     PORT_BITX(0x01, IP_ACTIVE_LOW, IPT_SERVICE, "Test Advance", KEYCODE_F1, IP_JOY_DEFAULT ) \
  418.     PORT_BITX(0x02, IP_ACTIVE_LOW, IPT_SERVICE, "Test Next line", KEYCODE_F2, IP_JOY_DEFAULT ) \
  419.     PORT_BITX(0x04, IP_ACTIVE_LOW, IPT_SERVICE, "Test Slew Up", KEYCODE_F5, IP_JOY_DEFAULT ) \
  420.     PORT_BITX(0x08, IP_ACTIVE_LOW, IPT_SERVICE, "Test Slew Down", KEYCODE_F6, IP_JOY_DEFAULT ) \
  421.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) \
  422.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) \
  423.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 ) \
  424.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_TILT )
  425.  
  426. #define UNKNOWN_PORT \
  427.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
  428.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
  429.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
  430.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
  431.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
  432.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
  433.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
  434.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  435.  
  436.  
  437. INPUT_PORTS_START( qix )
  438.     PORT_START    /* PIA 0 Port A (PLAYER 1) */
  439.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY )
  440.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY )
  441.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY )
  442.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY )
  443.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 )
  444.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
  445.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
  446.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
  447.  
  448.     PORT_START    /* PIA 0 Port B (COIN) */
  449.     COIN_PORT
  450.  
  451.     PORT_START    /* PIA 1 Port A (SPARE) */
  452.     UNKNOWN_PORT
  453.  
  454.     PORT_START /* PIA 1 Port B (PLAYER 1/2) */
  455.     UNKNOWN_PORT
  456.  
  457.     PORT_START    /* PIA 2 Port A (PLAYER 2) */
  458.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY | IPF_COCKTAIL )
  459.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_COCKTAIL )
  460.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_COCKTAIL )
  461.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_COCKTAIL )
  462.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  463.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  464.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  465.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  466. INPUT_PORTS_END
  467.  
  468. INPUT_PORTS_START( sdungeon )
  469.     PORT_START    /* PIA 0 Port A (PLAYER 1) */
  470.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP     | IPF_8WAY )
  471.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT  | IPF_8WAY )
  472.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN   | IPF_8WAY )
  473.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT   | IPF_8WAY )
  474.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP    | IPF_8WAY )
  475.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT | IPF_8WAY )
  476.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN  | IPF_8WAY )
  477.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT  | IPF_8WAY )
  478.  
  479.     PORT_START    /* PIA 0 Port B (COIN) */
  480.     COIN_PORT
  481.  
  482.     PORT_START    /* PIA 1 Port A (SPARE) */
  483.     UNKNOWN_PORT
  484.  
  485.     PORT_START /* PIA 1 Port B (PLAYER 1/2) */
  486.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  487.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  488.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
  489.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  490.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  491.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  492.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  493.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  494.  
  495.     PORT_START    /* PIA 2 Port A (PLAYER 2) */
  496.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP     | IPF_8WAY | IPF_COCKTAIL )
  497.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT  | IPF_8WAY | IPF_COCKTAIL )
  498.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN   | IPF_8WAY | IPF_COCKTAIL )
  499.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT   | IPF_8WAY | IPF_COCKTAIL )
  500.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP    | IPF_8WAY | IPF_COCKTAIL )
  501.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  502.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN  | IPF_8WAY | IPF_COCKTAIL )
  503.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  504. INPUT_PORTS_END
  505.  
  506. INPUT_PORTS_START( elecyoyo )
  507.     PORT_START    /* PIA 0 Port A (PLAYER 1) */
  508.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY )
  509.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY )
  510.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY )
  511.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY )
  512.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  513.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
  514.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
  515.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  516.  
  517.     PORT_START    /* PIA 0 Port B (COIN) */
  518.     COIN_PORT
  519.  
  520.     PORT_START    /* PIA 1 Port A (SPARE) */
  521.     UNKNOWN_PORT
  522.  
  523.     PORT_START /* PIA 1 Port B (PLAYER 1/2) */
  524.     UNKNOWN_PORT
  525.  
  526.     PORT_START    /* PIA 2 Port A (PLAYER 2) */
  527.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY | IPF_COCKTAIL )
  528.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_COCKTAIL )
  529.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_COCKTAIL )
  530.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_COCKTAIL )
  531.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  532.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  533.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  534.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  535. INPUT_PORTS_END
  536.  
  537. INPUT_PORTS_START( kram )
  538.     PORT_START    /* PIA 0 Port A (PLAYER 1) */
  539.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY )
  540.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  541.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  542.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  543.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 )
  544.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
  545.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
  546.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
  547.  
  548.     PORT_START    /* PIA 0 Port B (COIN) */
  549.     COIN_PORT
  550.  
  551.     PORT_START    /* PIA 1 Port A (SPARE) */
  552.     UNKNOWN_PORT
  553.  
  554.     PORT_START /* PIA 1 Port B (PLAYER 1/2) */
  555.     UNKNOWN_PORT
  556.  
  557.     PORT_START    /* PIA 2 Port A (PLAYER 2) */
  558.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
  559.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  560.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
  561.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  562.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  563.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  564.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  565.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  566. INPUT_PORTS_END
  567.  
  568. INPUT_PORTS_START( zookeep )
  569.     PORT_START    /* PIA 0 Port A (PLAYER 1) */
  570.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY )
  571.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY )
  572.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY )
  573.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY )
  574.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
  575.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
  576.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 )
  577.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  578.  
  579.     PORT_START    /* PIA 0 Port B (COIN) */
  580.     COIN_PORT
  581.  
  582.     PORT_START    /* PIA 1 Port A (SPARE) */
  583.     UNKNOWN_PORT
  584.  
  585.     PORT_START /* PIA 1 Port B (PLAYER 1/2) */
  586.     UNKNOWN_PORT
  587.  
  588.     PORT_START    /* PIA 2 Port A (PLAYER 2) */
  589.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY | IPF_COCKTAIL )
  590.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_COCKTAIL )
  591.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_COCKTAIL )
  592.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_COCKTAIL )
  593.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  594.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  595.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  596.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  597. INPUT_PORTS_END
  598.  
  599.  
  600.  
  601.  
  602. static struct DACinterface dac_interface =
  603. {
  604.     1,
  605.     { 100 }
  606. };
  607.  
  608.  
  609.  
  610. static struct MachineDriver machine_driver_qix =
  611. {
  612.     /* basic machine hardware */
  613.     {
  614.         {
  615.             CPU_M6809,
  616.             1250000,    /* 1.25 MHz */
  617.             readmem,writemem,0,0,
  618.             interrupt,1
  619.         },
  620.         {
  621.             CPU_M6809,
  622.             1250000,    /* 1.25 MHz */
  623.             readmem_video,writemem_video,0,0,
  624.             ignore_interrupt,0
  625.         },
  626.         {
  627.             CPU_M6802 | CPU_AUDIO_CPU,
  628.             3680000/4,    /* 0.92 MHz */
  629.             readmem_sound,writemem_sound,0,0,
  630.             ignore_interrupt,0
  631.         }
  632.     },
  633.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  634.     60,    /* 60 CPU slices per frame - an high value to ensure proper */
  635.         /* synchronization of the CPUs */
  636.     qix_init_machine,            /* init machine routine */ /* JB 970526 */
  637.  
  638.     /* video hardware */
  639.     256, 256,                    /* screen_width, screen_height */
  640.     { 0, 255, 8, 247 },         /* struct rectangle visible_area - just a guess */
  641.     0,                            /* GfxDecodeInfo * */
  642.     256,                        /* total colors */
  643.     0,                            /* color table length */
  644.     0,                            /* convert color prom routine */
  645.  
  646.     VIDEO_TYPE_RASTER|VIDEO_MODIFIES_PALETTE|VIDEO_SUPPORTS_DIRTY,
  647.     0,                            /* vh_init routine */
  648.     qix_vh_start,                /* vh_start routine */
  649.     qix_vh_stop,                /* vh_stop routine */
  650.     qix_vh_screenrefresh,        /* vh_update routine */
  651.  
  652.     /* sound hardware */
  653.     0,0,0,0,
  654.     {
  655.         {
  656.             SOUND_DAC,
  657.             &dac_interface
  658.         }
  659.     },
  660.  
  661.     nvram_handler
  662. };
  663.  
  664. static struct MachineDriver machine_driver_mcu =
  665. {
  666.     /* basic machine hardware */
  667.     {
  668.         {
  669.             CPU_M6809,
  670.             1250000,    /* 1.25 MHz */
  671.             readmem,writemem,0,0,
  672.             interrupt,1
  673.         },
  674.         {
  675.             CPU_M6809,
  676.             1250000,    /* 1.25 MHz */
  677.             readmem_video,writemem_video,0,0,
  678.             ignore_interrupt,0
  679.         },
  680.         {
  681.             CPU_M6802 | CPU_AUDIO_CPU,
  682.             3680000/4,    /* 0.92 MHz */
  683.             readmem_sound,writemem_sound,0,0,
  684.             ignore_interrupt,0
  685.         },
  686.         {
  687.             CPU_M68705,
  688.             4000000/2,    /* xtal is 4MHz, I think it's divided by 2 internally */
  689.             mcu_readmem,mcu_writemem,0,0,
  690.             ignore_interrupt,0      /* No periodic interrupt */
  691.         }
  692.     },
  693.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  694.     600,    /* 60 CPU slices per frame - an high value to ensure proper */
  695.         /* synchronization of the CPUs */
  696.     withmcu_init_machine,                       /* init machine routine */ /* JB 970526 */
  697.  
  698.     /* video hardware */
  699.     256, 256,                    /* screen_width, screen_height */
  700.     { 0, 255, 8, 247 },         /* struct rectangle visible_area - just a guess */
  701.     0,                            /* GfxDecodeInfo * */
  702.     256,                        /* total colors */
  703.     0,                            /* color table length */
  704.     0,                            /* convert color prom routine */
  705.  
  706.     VIDEO_TYPE_RASTER|VIDEO_MODIFIES_PALETTE|VIDEO_SUPPORTS_DIRTY,
  707.     0,                            /* vh_init routine */
  708.     qix_vh_start,                /* vh_start routine */
  709.     qix_vh_stop,                /* vh_stop routine */
  710.     qix_vh_screenrefresh,        /* vh_update routine */
  711.  
  712.     /* sound hardware */
  713.     0,0,0,0,
  714.     {
  715.         {
  716.             SOUND_DAC,
  717.             &dac_interface
  718.         }
  719.     },
  720.  
  721.     nvram_handler
  722. };
  723.  
  724. static struct MachineDriver machine_driver_zookeep =
  725. {
  726.     /* basic machine hardware */
  727.     {
  728.         {
  729.             CPU_M6809,
  730.             1250000,        /* 1.25 MHz */
  731.             zoo_readmem,zoo_writemem,0,0,
  732.             interrupt,1
  733.         },
  734.         {
  735.             CPU_M6809,
  736.             1250000,        /* 1.25 MHz */
  737.             zoo_readmem_video, zoo_writemem_video, 0, 0,
  738.             ignore_interrupt,0
  739.         },
  740.         {
  741.             CPU_M6802 | CPU_AUDIO_CPU,
  742.             3680000/4,        /* 0.92 MHz */
  743.             zoo_readmem_sound,zoo_writemem_sound,0,0,
  744.             ignore_interrupt,0
  745.         },
  746.         {
  747.             CPU_M68705,
  748.             4000000/2,    /* xtal is 4MHz, I think it's divided by 2 internally */
  749.             mcu_readmem,mcu_writemem,0,0,
  750.             ignore_interrupt,0      /* No periodic interrupt */
  751.         }
  752.     },
  753.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  754.     60,    /* 60 CPU slices per frame - an high value to ensure proper */
  755.         /* synchronization of the CPUs */
  756.     zoo_init_machine,                    /* init machine routine */
  757.  
  758.     /* video hardware */
  759.     256, 256,                    /* screen_width, screen_height */
  760.     { 0, 255, 8, 247 },         /* struct rectangle visible_area - just a guess */
  761.     0,                            /* GfxDecodeInfo * */
  762.     256,                        /* total colors */
  763.     0,                            /* color table length */
  764.     0,                            /* convert color prom routine */
  765.  
  766.     VIDEO_TYPE_RASTER|VIDEO_MODIFIES_PALETTE|VIDEO_SUPPORTS_DIRTY,
  767.     0,                            /* vh_init routine */
  768.     qix_vh_start,                /* vh_start routine */
  769.     qix_vh_stop,                /* vh_stop routine */
  770.     qix_vh_screenrefresh,        /* vh_update routine */
  771.  
  772.     /* sound hardware */
  773.     0,0,0,0,
  774.     {
  775.         {
  776.             SOUND_DAC,
  777.             &dac_interface
  778.         }
  779.     },
  780.  
  781.     nvram_handler
  782. };
  783.  
  784.  
  785.  
  786. /***************************************************************************
  787.  
  788.   Game driver(s)
  789.  
  790. ***************************************************************************/
  791.  
  792. ROM_START( qix )
  793.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code for the first CPU (Data) */
  794.     ROM_LOAD( "u12",          0xC000, 0x0800, 0xaad35508 )
  795.     ROM_LOAD( "u13",          0xC800, 0x0800, 0x46c13504 )
  796.     ROM_LOAD( "u14",          0xD000, 0x0800, 0x5115e896 )
  797.     ROM_LOAD( "u15",          0xD800, 0x0800, 0xccd52a1b )
  798.     ROM_LOAD( "u16",          0xE000, 0x0800, 0xcd1c36ee )
  799.     ROM_LOAD( "u17",          0xE800, 0x0800, 0x1acb682d )
  800.     ROM_LOAD( "u18",          0xF000, 0x0800, 0xde77728b )
  801.     ROM_LOAD( "u19",          0xF800, 0x0800, 0xc0994776 )
  802.  
  803.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for code for the second CPU (Video) */
  804.     ROM_LOAD( "u4",           0xC800, 0x0800, 0x5b906a09 )
  805.     ROM_LOAD( "u5",           0xD000, 0x0800, 0x254a3587 )
  806.     ROM_LOAD( "u6",           0xD800, 0x0800, 0xace30389 )
  807.     ROM_LOAD( "u7",           0xE000, 0x0800, 0x8ebcfa7c )
  808.     ROM_LOAD( "u8",           0xE800, 0x0800, 0xb8a3c8f9 )
  809.     ROM_LOAD( "u9",           0xF000, 0x0800, 0x26cbcd55 )
  810.     ROM_LOAD( "u10",          0xF800, 0x0800, 0x568be942 )
  811.  
  812.     ROM_REGION( 0x10000, REGION_CPU3 )     /* 64k for code for the third CPU (sound) */
  813.     ROM_LOAD( "u27",          0xF800, 0x0800, 0xf3782bd0 )
  814. ROM_END
  815.  
  816. ROM_START( qixa )
  817.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code for the first CPU (Data) */
  818.     ROM_LOAD( "qu12",         0xC000, 0x0800, 0x1c55b44d )
  819.     ROM_LOAD( "qu13",         0xC800, 0x0800, 0x20279e8c )
  820.     ROM_LOAD( "qu14",         0xD000, 0x0800, 0xbafe3ce3 )
  821.     /* d800-dfff empty */
  822.     ROM_LOAD( "qu16",         0xE000, 0x0800, 0xdb560753 )
  823.     ROM_LOAD( "qu17",         0xE800, 0x0800, 0x8c7aeed8 )
  824.     ROM_LOAD( "qu18",         0xF000, 0x0800, 0x353be980 )
  825.     ROM_LOAD( "qu19",         0xF800, 0x0800, 0xf46a69ca )
  826.  
  827.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for code for the second CPU (Video) */
  828.     ROM_LOAD( "qu3",          0xC000, 0x0800, 0x8b4c0ef0 )
  829.     ROM_LOAD( "qu4",          0xC800, 0x0800, 0x66a5c260 )
  830.     ROM_LOAD( "qu5",          0xD000, 0x0800, 0x70160ea3 )
  831.     /* d800-dfff empty */
  832.     ROM_LOAD( "qu7",          0xE000, 0x0800, 0xd6733019 )
  833.     ROM_LOAD( "qu8",          0xE800, 0x0800, 0x66870dcc )
  834.     ROM_LOAD( "qu9",          0xF000, 0x0800, 0xc99bf94d )
  835.     ROM_LOAD( "qu10",         0xF800, 0x0800, 0x88b45037 )
  836.  
  837.     ROM_REGION( 0x10000, REGION_CPU3 )     /* 64k for code for the third CPU (sound) */
  838.     ROM_LOAD( "u27",          0xF800, 0x0800, 0xf3782bd0 )
  839. ROM_END
  840.  
  841. ROM_START( qixb )
  842.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code for the first CPU (Data) */
  843.     ROM_LOAD( "lk14.bin",     0xC000, 0x1000, 0x6d164986 )
  844.     ROM_LOAD( "lk15.bin",     0xD000, 0x1000, 0x16c6ce0f )
  845.     ROM_LOAD( "lk16.bin",     0xE000, 0x1000, 0x698b1f9c )
  846.     ROM_LOAD( "lk17.bin",     0xF000, 0x1000, 0x7e3adde6 )
  847.  
  848.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for code for the second CPU (Video) */
  849.     ROM_LOAD( "lk10.bin",     0xC000, 0x1000, 0x7eac67d0 )
  850.     ROM_LOAD( "lk11.bin",     0xD000, 0x1000, 0x90ccbb6a )
  851.     ROM_LOAD( "lk12.bin",     0xE000, 0x1000, 0xbe9b9f7d )
  852.     ROM_LOAD( "lk13.bin",     0xF000, 0x1000, 0x51c9853b )
  853.  
  854.     ROM_REGION( 0x10000, REGION_CPU3 )     /* 64k for code for the third CPU (sound) */
  855.     ROM_LOAD( "u27",          0xF800, 0x0800, 0xf3782bd0 )
  856. ROM_END
  857.  
  858. ROM_START( qix2 )
  859.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code for the first CPU (Data) */
  860.     ROM_LOAD( "u12.rmb",      0xC000, 0x0800, 0x484280fd )
  861.     ROM_LOAD( "u13.rmb",      0xC800, 0x0800, 0x3d089fcb )
  862.     ROM_LOAD( "u14.rmb",      0xD000, 0x0800, 0x362123a9 )
  863.     ROM_LOAD( "u15.rmb",      0xD800, 0x0800, 0x60f3913d )
  864.     ROM_LOAD( "u16.rmb",      0xE000, 0x0800, 0xcc139e34 )
  865.     ROM_LOAD( "u17.rmb",      0xE800, 0x0800, 0xcf31dc49 )
  866.     ROM_LOAD( "u18.rmb",      0xF000, 0x0800, 0x1f91ed7a )
  867.     ROM_LOAD( "u19.rmb",      0xF800, 0x0800, 0x68e8d5a6 )
  868.  
  869.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for code for the second CPU (Video) */
  870.     ROM_LOAD( "u3.rmb",       0xC000, 0x0800, 0x19cebaca )
  871.     ROM_LOAD( "u4.rmb",       0xC800, 0x0800, 0x6cfb4185 )
  872.     ROM_LOAD( "u5.rmb",       0xD000, 0x0800, 0x948f53f3 )
  873.     ROM_LOAD( "u6.rmb",       0xD800, 0x0800, 0x8630120e )
  874.     ROM_LOAD( "u7.rmb",       0xE000, 0x0800, 0xbad037c9 )
  875.     ROM_LOAD( "u8.rmb",       0xE800, 0x0800, 0x3159bc00 )
  876.     ROM_LOAD( "u9.rmb",       0xF000, 0x0800, 0xe80e9b1d )
  877.     ROM_LOAD( "u10.rmb",      0xF800, 0x0800, 0x9a55d360 )
  878.  
  879.     ROM_REGION( 0x10000, REGION_CPU3 )     /* 64k for code for the third CPU (sound) */
  880.     ROM_LOAD( "u27",          0xF800, 0x0800, 0xf3782bd0 )
  881. ROM_END
  882.  
  883. ROM_START( sdungeon )
  884.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code for the first CPU (Data) */
  885.     ROM_LOAD( "sd14.u14",     0xA000, 0x1000, 0x7024b55a )
  886.     ROM_LOAD( "sd15.u15",     0xB000, 0x1000, 0xa3ac9040 )
  887.     ROM_LOAD( "sd16.u16",     0xC000, 0x1000, 0xcc20b580 )
  888.     ROM_LOAD( "sd17.u17",     0xD000, 0x1000, 0x4663e4b8 )
  889.     ROM_LOAD( "sd18.u18",     0xE000, 0x1000, 0x7ef1ffc0 )
  890.     ROM_LOAD( "sd19.u19",     0xF000, 0x1000, 0x7b20b7ac )
  891.  
  892.     ROM_REGION( 0x12000, REGION_CPU2 )     /* 64k for code + 2 ROM banks for the second CPU (Video) */
  893.     ROM_LOAD( "sd05.u5",      0x0A000, 0x1000, 0x0b2bf48e )
  894.     ROM_LOAD( "sd06.u6",      0x0B000, 0x1000, 0xf86db512 )
  895.     ROM_LOAD( "sd07.u7",      0x0C000, 0x1000, 0x7b796831 )
  896.     ROM_LOAD( "sd08.u8",      0x0D000, 0x1000, 0x5fbe7068 )
  897.     ROM_LOAD( "sd09.u9",      0x0E000, 0x1000, 0x89bc51ea )
  898.     ROM_LOAD( "sd10.u10",     0x0F000, 0x1000, 0x754de734 )
  899.  
  900.     ROM_REGION( 0x10000, REGION_CPU3 )     /* 64k for code for the third CPU (sound) */
  901.     ROM_LOAD( "sd26.u26",     0xF000, 0x0800, 0x3df8630d )
  902.     ROM_LOAD( "sd27.u27",     0xF800, 0x0800, 0x0386f351 )
  903.  
  904.     ROM_REGION( 0x0800, REGION_CPU4 )    /* 2k for the 68705 microcontroller */
  905.     ROM_LOAD( "sd101",        0x0000, 0x0800, 0xe255af9a )
  906. ROM_END
  907.  
  908. ROM_START( elecyoyo )
  909.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code for the first CPU (Data) */
  910.     ROM_LOAD( "yy14",         0xA000, 0x1000, 0x0d2edcb9 )
  911.     ROM_LOAD( "yy15",         0xB000, 0x1000, 0xa91f01e3 )
  912.     ROM_LOAD( "yy16-1",       0xC000, 0x1000, 0x2710f360 )
  913.     ROM_LOAD( "yy17",         0xD000, 0x1000, 0x25fd489d )
  914.     ROM_LOAD( "yy18",         0xE000, 0x1000, 0x0b6661c0 )
  915.     ROM_LOAD( "yy19-1",       0xF000, 0x1000, 0x95b8b244 )
  916.  
  917.     ROM_REGION( 0x12000, REGION_CPU2 )     /* 64k for code + 2 ROM banks for the second CPU (Video) */
  918.     ROM_LOAD( "yy5",          0x0A000, 0x1000, 0x3793fec5 )
  919.     ROM_LOAD( "yy6",          0x0B000, 0x1000, 0x2e8b1265 )
  920.     ROM_LOAD( "yy7",          0x0C000, 0x1000, 0x20f93411 )
  921.     ROM_LOAD( "yy8",          0x0D000, 0x1000, 0x926f90c8 )
  922.     ROM_LOAD( "yy9",          0x0E000, 0x1000, 0x2f999480 )
  923.     ROM_LOAD( "yy10",         0x0F000, 0x1000, 0xb31d20e2 )
  924.  
  925.     ROM_REGION( 0x10000, REGION_CPU3 )     /* 64k for code for the third CPU (sound) */
  926.     ROM_LOAD( "yy27",         0xF800, 0x0800, 0x5a2aa0f3 )
  927.  
  928.     ROM_REGION( 0x0800, REGION_CPU4 )    /* 2k for the 68705 microcontroller */
  929.     ROM_LOAD( "yy101",        0x0000, 0x0800, 0x3cf13038 )
  930. ROM_END
  931.  
  932. ROM_START( elecyoy2 )
  933.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code for the first CPU (Data) */
  934.     ROM_LOAD( "yy14",         0xA000, 0x1000, 0x0d2edcb9 )
  935.     ROM_LOAD( "yy15",         0xB000, 0x1000, 0xa91f01e3 )
  936.     ROM_LOAD( "yy16",         0xC000, 0x1000, 0xcab19f3a )
  937.     ROM_LOAD( "yy17",         0xD000, 0x1000, 0x25fd489d )
  938.     ROM_LOAD( "yy18",         0xE000, 0x1000, 0x0b6661c0 )
  939.     ROM_LOAD( "yy19",         0xF000, 0x1000, 0xd0215d2e )
  940.  
  941.     ROM_REGION( 0x12000, REGION_CPU2 )     /* 64k for code + 2 ROM banks for the second CPU (Video) */
  942.     ROM_LOAD( "yy5",          0x0A000, 0x1000, 0x3793fec5 )
  943.     ROM_LOAD( "yy6",          0x0B000, 0x1000, 0x2e8b1265 )
  944.     ROM_LOAD( "yy7",          0x0C000, 0x1000, 0x20f93411 )
  945.     ROM_LOAD( "yy8",          0x0D000, 0x1000, 0x926f90c8 )
  946.     ROM_LOAD( "yy9",          0x0E000, 0x1000, 0x2f999480 )
  947.     ROM_LOAD( "yy10",         0x0F000, 0x1000, 0xb31d20e2 )
  948.  
  949.     ROM_REGION( 0x10000, REGION_CPU3 )     /* 64k for code for the third CPU (sound) */
  950.     ROM_LOAD( "yy27",         0xF800, 0x0800, 0x5a2aa0f3 )
  951.  
  952.     ROM_REGION( 0x0800, REGION_CPU4 )    /* 2k for the 68705 microcontroller */
  953.     ROM_LOAD( "yy101",        0x0000, 0x0800, 0x3cf13038 )
  954. ROM_END
  955.  
  956. ROM_START( kram )
  957.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code for the first CPU (Data) */
  958.     ROM_LOAD( "ks14-1",       0xA000, 0x1000, 0xfe69ac79 )
  959.     ROM_LOAD( "ks15",         0xB000, 0x1000, 0x4b2c175e )
  960.     ROM_LOAD( "ks16",         0xC000, 0x1000, 0x9500a05d )
  961.     ROM_LOAD( "ks17",         0xD000, 0x1000, 0xc752a3a1 )
  962.     ROM_LOAD( "ks18",         0xE000, 0x1000, 0x79158b03 )
  963.     ROM_LOAD( "ks19-1",       0xF000, 0x1000, 0x759ea6ce )
  964.  
  965.     ROM_REGION( 0x12000, REGION_CPU2 )     /* 64k for code + 2 ROM banks for the second CPU (Video) */
  966.     ROM_LOAD( "ks5",          0x0A000, 0x1000, 0x1c472080 )
  967.     ROM_LOAD( "ks6",          0x0B000, 0x1000, 0xb8926622 )
  968.     ROM_LOAD( "ks7",          0x0C000, 0x1000, 0xc98a7485 )
  969.     ROM_LOAD( "ks8",          0x0D000, 0x1000, 0x1127c4e4 )
  970.     ROM_LOAD( "ks9",          0x0E000, 0x1000, 0xd3bc8b5e )
  971.     ROM_LOAD( "ks10",         0x0F000, 0x1000, 0xe0426444 )
  972.  
  973.     ROM_REGION( 0x10000, REGION_CPU3 )     /* 64k for code for the third CPU (sound) */
  974.     ROM_LOAD( "ks27",         0xf800, 0x0800, 0xc46530c8 )
  975.  
  976.     ROM_REGION( 0x0800, REGION_CPU4 )    /* 2k for the 68705 microcontroller */
  977.     ROM_LOAD( "ks101.dat",    0x0000, 0x0800, 0xe53d97b7 )
  978. ROM_END
  979.  
  980. ROM_START( kram2 )
  981.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code for the first CPU (Data) */
  982.     ROM_LOAD( "ks14",         0xA000, 0x1000, 0xa2eac1ff )
  983.     ROM_LOAD( "ks15",         0xB000, 0x1000, 0x4b2c175e )
  984.     ROM_LOAD( "ks16",         0xC000, 0x1000, 0x9500a05d )
  985.     ROM_LOAD( "ks17",         0xD000, 0x1000, 0xc752a3a1 )
  986.     ROM_LOAD( "ks18",         0xE000, 0x1000, 0x79158b03 )
  987.     ROM_LOAD( "ks19",         0xF000, 0x1000, 0x053c5e09 )
  988.  
  989.     ROM_REGION( 0x12000, REGION_CPU2 )     /* 64k for code + 2 ROM banks for the second CPU (Video) */
  990.     ROM_LOAD( "ks5",          0x0A000, 0x1000, 0x1c472080 )
  991.     ROM_LOAD( "ks6",          0x0B000, 0x1000, 0xb8926622 )
  992.     ROM_LOAD( "ks7",          0x0C000, 0x1000, 0xc98a7485 )
  993.     ROM_LOAD( "ks8",          0x0D000, 0x1000, 0x1127c4e4 )
  994.     ROM_LOAD( "ks9",          0x0E000, 0x1000, 0xd3bc8b5e )
  995.     ROM_LOAD( "ks10",         0x0F000, 0x1000, 0xe0426444 )
  996.  
  997.     ROM_REGION( 0x10000, REGION_CPU3 )     /* 64k for code for the third CPU (sound) */
  998.     ROM_LOAD( "ks27",         0xf800, 0x0800, 0xc46530c8 )
  999.  
  1000.     ROM_REGION( 0x0800, REGION_CPU4 )    /* 2k for the 68705 microcontroller */
  1001.     ROM_LOAD( "ks101.dat",    0x0000, 0x0800, 0xe53d97b7 )
  1002. ROM_END
  1003.  
  1004. ROM_START( zookeep )
  1005.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code for the first CPU (Data) */
  1006.     ROM_LOAD( "za12",         0x8000, 0x1000, 0x4e40d8dc )
  1007.     ROM_LOAD( "za13",         0x9000, 0x1000, 0xeebd5248 )
  1008.     ROM_LOAD( "za14",         0xA000, 0x1000, 0xfab43297 )
  1009.     ROM_LOAD( "za15",         0xB000, 0x1000, 0xef8cd67c )
  1010.     ROM_LOAD( "za16",         0xC000, 0x1000, 0xccfc15bc )
  1011.     ROM_LOAD( "za17",         0xD000, 0x1000, 0x358013f4 )
  1012.     ROM_LOAD( "za18",         0xE000, 0x1000, 0x37886afe )
  1013.     ROM_LOAD( "za19",         0xF000, 0x1000, 0xbbfb30d9 )
  1014.  
  1015.     ROM_REGION( 0x12000, REGION_CPU2 )     /* 64k for code + 2 ROM banks for the second CPU (Video) */
  1016.     ROM_LOAD( "za5",          0x0A000, 0x1000, 0xdc0c3cbd )
  1017.     ROM_LOAD( "za3",          0x10000, 0x1000, 0xcc4d0aee )
  1018.     ROM_LOAD( "za6",          0x0B000, 0x1000, 0x27c787dd )
  1019.     ROM_LOAD( "za4",          0x11000, 0x1000, 0xec3b10b1 )
  1020.  
  1021.     ROM_LOAD( "za7",          0x0C000, 0x1000, 0x1479f480 )
  1022.     ROM_LOAD( "za8",          0x0D000, 0x1000, 0x4c96cdb2 )
  1023.     ROM_LOAD( "za9",          0x0E000, 0x1000, 0xa4f7d9e0 )
  1024.     ROM_LOAD( "za10",         0x0F000, 0x1000, 0x05df1a5a )
  1025.  
  1026.     ROM_REGION( 0x10000, REGION_CPU3 )     /* 64k for code for the third CPU (sound) */
  1027.     ROM_LOAD( "za25",         0xD000, 0x1000, 0x779b8558 )
  1028.     ROM_LOAD( "za26",         0xE000, 0x1000, 0x60a810ce )
  1029.     ROM_LOAD( "za27",         0xF000, 0x1000, 0x99ed424e )
  1030.  
  1031.     ROM_REGION( 0x0800, REGION_CPU4 )    /* 2k for the 68705 microcontroller */
  1032.     ROM_LOAD( "za_coin.bin",  0x0000, 0x0800, 0x364d3557 )
  1033. ROM_END
  1034.  
  1035. ROM_START( zookeep2 )
  1036.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code for the first CPU (Data) */
  1037.     ROM_LOAD( "za12",         0x8000, 0x1000, 0x4e40d8dc )
  1038.     ROM_LOAD( "za13",         0x9000, 0x1000, 0xeebd5248 )
  1039.     ROM_LOAD( "za14",         0xA000, 0x1000, 0xfab43297 )
  1040.     ROM_LOAD( "za15",         0xB000, 0x1000, 0xef8cd67c )
  1041.     ROM_LOAD( "za16",         0xC000, 0x1000, 0xccfc15bc )
  1042.     ROM_LOAD( "za17",         0xD000, 0x1000, 0x358013f4 )
  1043.     ROM_LOAD( "za18",         0xE000, 0x1000, 0x37886afe )
  1044.     ROM_LOAD( "za19.red",     0xF000, 0x1000, 0xec01760e )
  1045.  
  1046.     ROM_REGION( 0x12000, REGION_CPU2 )     /* 64k for code + 2 ROM banks for the second CPU (Video) */
  1047.     ROM_LOAD( "za5",          0x0A000, 0x1000, 0xdc0c3cbd )
  1048.     ROM_LOAD( "za3",          0x10000, 0x1000, 0xcc4d0aee )
  1049.     ROM_LOAD( "za6",          0x0B000, 0x1000, 0x27c787dd )
  1050.     ROM_LOAD( "za4",          0x11000, 0x1000, 0xec3b10b1 )
  1051.  
  1052.     ROM_LOAD( "za7",          0x0C000, 0x1000, 0x1479f480 )
  1053.     ROM_LOAD( "za8",          0x0D000, 0x1000, 0x4c96cdb2 )
  1054.     ROM_LOAD( "za9",          0x0E000, 0x1000, 0xa4f7d9e0 )
  1055.     ROM_LOAD( "za10",         0x0F000, 0x1000, 0x05df1a5a )
  1056.  
  1057.     ROM_REGION( 0x10000, REGION_CPU3 )     /* 64k for code for the third CPU (sound) */
  1058.     ROM_LOAD( "za25",         0xD000, 0x1000, 0x779b8558 )
  1059.     ROM_LOAD( "za26",         0xE000, 0x1000, 0x60a810ce )
  1060.     ROM_LOAD( "za27",         0xF000, 0x1000, 0x99ed424e )
  1061.  
  1062.     ROM_REGION( 0x0800, REGION_CPU4 )    /* 2k for the 68705 microcontroller */
  1063.     ROM_LOAD( "za_coin.bin",  0x0000, 0x0800, 0x364d3557 )
  1064. ROM_END
  1065.  
  1066. ROM_START( zookeep3 )
  1067.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code for the first CPU (Data) */
  1068.     ROM_LOAD( "za12",         0x8000, 0x1000, 0x4e40d8dc )
  1069.     ROM_LOAD( "za13",         0x9000, 0x1000, 0xeebd5248 )
  1070.     ROM_LOAD( "za14",         0xA000, 0x1000, 0xfab43297 )
  1071.     ROM_LOAD( "za15",         0xB000, 0x1000, 0xef8cd67c )
  1072.     ROM_LOAD( "za16",         0xC000, 0x1000, 0xccfc15bc )
  1073.     ROM_LOAD( "za17",         0xD000, 0x1000, 0x358013f4 )
  1074.     ROM_LOAD( "za18",         0xE000, 0x1000, 0x37886afe )
  1075.     ROM_LOAD( "za19",         0xF000, 0x1000, 0xbbfb30d9 )
  1076.  
  1077.     ROM_REGION( 0x12000, REGION_CPU2 )     /* 64k for code + 2 ROM banks for the second CPU (Video) */
  1078.     ROM_LOAD( "za5",          0x0A000, 0x1000, 0xdc0c3cbd )
  1079.     ROM_LOAD( "za3",          0x10000, 0x1000, 0xcc4d0aee )
  1080.     ROM_LOAD( "za6",          0x0B000, 0x1000, 0x27c787dd )
  1081.     ROM_LOAD( "za4",          0x11000, 0x1000, 0xec3b10b1 )
  1082.  
  1083.     ROM_LOAD( "za7",          0x0C000, 0x1000, 0x1479f480 )
  1084.     ROM_LOAD( "za8",          0x0D000, 0x1000, 0x4c96cdb2 )
  1085.     ROM_LOAD( "zv35.9",       0x0E000, 0x1000, 0xd14123b7 )
  1086.     ROM_LOAD( "zv36.10",      0x0F000, 0x1000, 0x23705777 )
  1087.  
  1088.     ROM_REGION( 0x10000, REGION_CPU3 )     /* 64k for code for the third CPU (sound) */
  1089.     ROM_LOAD( "za25",         0xD000, 0x1000, 0x779b8558 )
  1090.     ROM_LOAD( "za26",         0xE000, 0x1000, 0x60a810ce )
  1091.     ROM_LOAD( "za27",         0xF000, 0x1000, 0x99ed424e )
  1092.  
  1093.     ROM_REGION( 0x0800, REGION_CPU4 )    /* 2k for the 68705 microcontroller */
  1094.     ROM_LOAD( "za_coin.bin",  0x0000, 0x0800, 0x364d3557 )
  1095. ROM_END
  1096.  
  1097.  
  1098.  
  1099. GAMEX( 1981, qix,      0,        qix,     qix,      0, ROT270, "Taito America Corporation", "Qix (set 1)", GAME_NO_COCKTAIL )
  1100. GAMEX( 1981, qixa,     qix,      qix,     qix,      0, ROT270, "Taito America Corporation", "Qix (set 2)", GAME_NO_COCKTAIL )
  1101. GAMEX( 1981, qixb,     qix,      qix,     qix,      0, ROT270, "Taito America Corporation", "Qix (set 3)", GAME_NO_COCKTAIL )
  1102. GAMEX( 1981, qix2,     qix,      qix,     qix,      0, ROT270, "Taito America Corporation", "Qix II (Tournament)", GAME_NO_COCKTAIL )
  1103. GAMEX( 1981, sdungeon, 0,        mcu,     sdungeon, 0, ROT270, "Taito America Corporation", "Space Dungeon", GAME_NO_COCKTAIL )
  1104. GAMEX( 1982, elecyoyo, 0,        mcu,     elecyoyo, 0, ROT270, "Taito America Corporation", "The Electric Yo-Yo (set 1)", GAME_NO_COCKTAIL )
  1105. GAMEX( 1982, elecyoy2, elecyoyo, mcu,     elecyoyo, 0, ROT270, "Taito America Corporation", "The Electric Yo-Yo (set 2)", GAME_NO_COCKTAIL )
  1106. GAMEX( 1982, kram,     0,        mcu,     kram,     0, ROT0,   "Taito America Corporation", "Kram (set 1)", GAME_NO_COCKTAIL )
  1107. GAMEX( 1982, kram2,    kram,     mcu,     kram,     0, ROT0,   "Taito America Corporation", "Kram (set 2)", GAME_NO_COCKTAIL )
  1108. GAMEX( 1982, zookeep,  0,        zookeep, zookeep,  0, ROT0,   "Taito America Corporation", "Zoo Keeper (set 1)", GAME_NO_COCKTAIL )
  1109. GAMEX( 1982, zookeep2, zookeep,  zookeep, zookeep,  0, ROT0,   "Taito America Corporation", "Zoo Keeper (set 2)", GAME_NO_COCKTAIL )
  1110. GAMEX( 1982, zookeep3, zookeep,  zookeep, zookeep,  0, ROT0,   "Taito America Corporation", "Zoo Keeper (set 3)", GAME_NO_COCKTAIL )
  1111.